import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/widgets.dart';

class LoginState implements Cloneable<LoginState> {

  ///
  ///定义刷新页面时候动态变化的数据.
  ///
  TextEditingController usernameController;
  TextEditingController passwordController;
  Map<String, dynamic> data;

  ///
  ///这里把要改变的数据拿到以后等着 reducer进行clone
  ///
  @override
  LoginState clone() {
    return LoginState()
      ..data = data
      ..passwordController = passwordController
      ..usernameController = usernameController;
  }
}
///
///初始化 等同于在 widget 里面进行 对象的new,
///方法名叫做 initstate 也说明这一点
///
LoginState initState(Map<String, dynamic> args) {
  LoginState state = LoginState();
  state.data = Map();
  state.usernameController = TextEditingController();
  state.passwordController = TextEditingController();
  return state;
}
